<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-用户中心</title>
	<link rel="stylesheet" type="text/css" th:href="@{/css/reset.css}">
	<link rel="stylesheet" type="text/css" th:href="@{/css/main.css}">
	<script type="text/javascript" th:src="@{/js/jquery-1.12.4.min.js}"></script>
	<script type="text/javascript" th:src="@{/js/jquery-ui.min.js}"></script>
	<script type="text/javascript" th:src="@{/js/slide.js}"></script>
</head>
<body>
<div th:replace="top::top"></div>

	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="getUser_center_infoPage">· 个人信息</a></li>
				<li><a href="getOrderListPage">· 全部订单</a></li>
				<li><a href="getUser_center_sitePage" class="active">· 收货地址</a></li>
			</ul>
		</div>
		<div class="right_content clearfix">
				<h3 class="common_title2">收货地址</h3>
				<div class="site_con">
					<dl>
						<dt>当前地址：</dt>
						<th:block th:each="shipping:${shippingList}">
							<dd name="shipping" th:value="${shipping.id}" type="radio">
								<span th:text="|${shipping.receiverProvince}
								 ${shipping.receiverCity}
								 ${shipping.receiverDistrict}
								 ${shipping.receiverName}
								 ${shipping.receiverPhone}
								 ${shipping.receiverAddress}|">
								</span>
							</dd>
						</th:block>
					</dl>					
				</div>
			<dl>
				<th:block th:each="shipping:${shippingList}">
			<h3 class="common_title2">编辑地址：</h3>
				<div class="site_con">
					<form>
						<div class="form_group form_group2">
							<label>收件人</label>
							<textarea class="site_area" th:text="|${shipping.receiverName}|" name="receiverName"></textarea>

						</div>
						<div class="form_group form_group2">
							<label>详细地址：</label>
							<textarea class="site_area" th:text="|${shipping.receiverAddress}|" name="address"></textarea>
						</div>
						<div class="form_group form_group2">
							<label>邮编：</label>
							<textarea class="site_area" th:text="|${shipping.receiverZip}|" name="address"></textarea>

						</div>
						<div class="form_group form_group2">
							<label>手机：</label>
							<textarea class="site_area" th:text="|${shipping.receiverPhone}|" name="address"></textarea>

						</div>

						<input type="submit" onclick="submitForm()" name="" value="提交" class="info_submit">
					</form>
				</div>
				</th:block>
			</dl>
		</div>
	</div>



	<div class="footer">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>		
		</div>
		<p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
		<p>电话：010-****888    京ICP备*******8号</p>
	</div>

<script>
	function submitForm() {
		$.post(
				'/order/update',
				$('#formId').serialize(),
				function(jsonResult) {
					console.log(jsonResult);
					if (jsonResult.ok) {
						mylayer.okMsg(jsonResult.msg)
						//关闭弹出框
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
						//刷新父页面
						window.parent.location.reload();
					} else {
						mylayer.errorMsg(jsonResult.msg);
					}
				},
				'json'
		);
	}
</script>
	
</body>
</html>